//
//  BillVC.m
//  saler-ios
//
//  Created by 王亚陆 on 17/5/31.
//  Copyright © 2017年 sayimba. All rights reserved.
//

#import "BillVC.h"

@interface BillVC ()<UITableViewDelegate,UITableViewDataSource>
{
    UIImageView * nav;
    Common * com;
    RootViewController * TabBar;
    

}
@property (nonatomic,strong) UITableView * tableView;
@property (nonatomic,strong) UIView * backview;
@property (nonatomic,strong) UILabel * moneyLabel;
@end

@implementation BillVC

- (void)viewDidLoad {
    [super viewDidLoad];
    nav = [self createNav:@"销售账单"];
    [self.view addSubview:nav];
    
    [self createUI];
    
    [self createTable];
}


-(void)createUI{
    
    
    _backview = [[UIView alloc]init];
    [self.view addSubview:_backview];
    
    [_backview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(nav.mas_bottom);
        make.centerX.mas_equalTo(self.view.mas_centerX);
        make.size.mas_equalTo(CGSizeMake(Main_Width, 200));
    }];
    
    
    UIImageView * image = [[UIImageView alloc]init];
    image.backgroundColor = CyanColor;
    LRViewBorderRadius(image, 0.5, 100, fontGrayColor);
    [_backview addSubview:image];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(_backview.mas_centerY);
        make.centerX.mas_equalTo(self.view.mas_centerX);
        make.size.mas_equalTo(CGSizeMake(100*kWidth, 100*kHeight));
    }];
    
}

-(void)createTable{
    
    self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0,10, screenWidth, cellHeight * 4 - 2) style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    
    [self.view addSubview:self.tableView];
    self.tableView.scrollEnabled = NO;
    

    
    
    
}


#pragma mark - 表代理
- (NSInteger)tableView:(UITableView *)tableView
 numberOfRowsInSection:(NSInteger)section{
//    return self.dataArray.count;
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    NSString *string = @"wallet";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:string];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:string];
    }
    

    return cell;
    
}

- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    

}

- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return cellHeight;
}





- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    
    RootViewController *rootVC = [RootViewController defaultsTabBar];
    [rootVC setTabBarHidden:YES];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
